#include <cstdio>

void swapReferences(int& n,int& m){
    int temp = n;
    n=m;
    m=temp;
}

void swapPrint(int* n,int* m){
    int temp = *n;
    *n=*m;
    *m=temp;
}

int main(){
    int a = 1;
    int b = 2;
    int* pa = &a;
    int& ra = a;
    printf("a address: %p\n", &a);
    printf("a print: %p\n", pa);
    printf("a references: %d\n", ra);
    swapReferences(a,b);
    printf("a,b:%d,%d\n",a,b);
    swapPrint(&a,&b);
    printf("a,b:%d,%d\n",a,b);

}